package com.education.wisdom.service.impl;

import com.education.common.utils.Convert;
import com.education.wisdom.mapper.MerchantOrderMapper;
import com.education.wisdom.pojo.MerchantOrder;
import com.education.wisdom.service.IMerchantOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * 订单 服务层实现
 * 
 * @author ruoyi
 * @date 2018-11-23
 */
@Service
public class MerchantOrderServiceImpl implements IMerchantOrderService
{
	@Autowired
	private MerchantOrderMapper merchantOrderMapper;

	/**
     * 查询订单信息
     * 
     * @param orderId 订单ID
     * @return 订单信息
     */
    @Override
	public MerchantOrder selectMerchantOrderById(String orderId)
	{
	    return merchantOrderMapper.selectMerchantOrderById(orderId);
	}

	/**
     * 查询订单列表
     * 
     * @param merchantOrder 订单信息
     * @return 订单集合
     */
	@Override
	public List<MerchantOrder> selectMerchantOrderList(MerchantOrder merchantOrder)
	{
	    return merchantOrderMapper.selectMerchantOrderList(merchantOrder);
	}
	
    /**
     * 新增订单
     * 
     * @param merchantOrder 订单信息
     * @return 结果
     */
	@Override
	public int insertMerchantOrder(MerchantOrder merchantOrder)
	{
	    return merchantOrderMapper.insertMerchantOrder(merchantOrder);
	}
	
	/**
     * 修改订单
     * 
     * @param merchantOrder 订单信息
     * @return 结果
     */
	@Override
	public int updateMerchantOrder(MerchantOrder merchantOrder)
	{
	    return merchantOrderMapper.updateMerchantOrder(merchantOrder);
	}

	/**
     * 删除订单对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
	@Override
	public int deleteMerchantOrderByIds(String ids)
	{
		return merchantOrderMapper.deleteMerchantOrderByIds(Convert.toStrArray(ids));
	}
	//查询用户订单
	@Override
	public List<MerchantOrder> selectOrderList(Map<String, Object> map) {
		return merchantOrderMapper.selectOrderList(map);
	}
	
}
